Skip to content

Add keyboard shortcut to switch between tabs#1250

Open
lasersushi wants to merge 5 commits into
TheBoredTeam:devfrom
lasersushi:feature/tab-switching-shortcut
Open

Add keyboard shortcut to switch between tabs#1250
lasersushi wants to merge 5 commits into
TheBoredTeam:devfrom
lasersushi:feature/tab-switching-shortcut

Conversation

@lasersushi

Copy link
Copy Markdown

Summary

Adds a customizable keyboard shortcut for switching between the Home and Shelf views in the notch. The default shortcut is ⌘⇧Y, configurable from the Shortcuts settings.

When the shortcut is pressed:

  • If the notch is open, it switches between the Home and Shelf
  • If the notch is closed, it opens the notch on the screen the cursor is currently on, switches the view, and auto-closes after 3 seconds

Implements the feature request in #1195.

Note: The original request suggested left/right arrow keys as the default, but those would conflict with too many system and app shortcuts. ⌘⇧Y was chosen to be consistent with the existing shortcut style in this app — it's fully rebindable via the Shortcuts settings.

Changes

  • ShortcutConstants — new switchTab KeyboardShortcuts.Name with default ⌘⇧Y
  • ShortcutsSettingsView — new KeyboardShortcuts.Recorder row labeled "Switch Tab:"
  • boringNotchApp — new KeyboardShortcuts.onKeyDown handler that:
    • resolves the correct view model for the screen under the cursor (when Show on all displays is enabled)
    • toggles coordinator.currentView between .home and .shelf with a smooth animation
    • opens the notch if closed, then schedules a cancellable auto-close after 3 seconds
  • Localizable.xcstrings — auto-generated entries for the new "Switch Tab:" label

Testing with Xcode

  • Pressing ⌘⇧Y with the notch open correctly toggles between Home and Shelf views
  • Pressing ⌘⇧Y with the notch closed opens the notch, switches the view, and auto-closes after 3 seconds
  • Rebinding the shortcut in Settings → Shortcuts works and persists across restarts
  • With Show on all displays enabled, the shortcut opens the notch on whichever screen the cursor is currently on
  • Repeatedly pressing the shortcut while the auto-close timer is running cancels the previous timer and restarts it (no flicker / premature close)

Screen Recordings

Screen.Recording.2026-05-12.at.5.41.38.PM.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant